package com.demon.framework.util.page;

import com.github.pagehelper.PageInfo;

/**
 * @author Demon-HY
 * @description
 * @date 2020/6/11 11:43
 */
public class PageInfoUtil {

    /**
     * 转换分页
     *
     * @param from   来源
     * @param target 目标
     */
    public static void convertPageInfo(PageInfo from, PageInfo target) {
        target.setPageNum(from.getPageNum());
        target.setPageSize(from.getPageSize());
        target.setSize(from.getSize());
        target.setStartRow(from.getStartRow());
        target.setEndRow(from.getEndRow());
        target.setPages(from.getPages());
        target.setFirstPage(from.getFirstPage());
        target.setPrePage(from.getPrePage());
        target.setNextPage(from.getNextPage());
        target.setLastPage(from.getLastPage());
        target.setIsFirstPage(from.isIsFirstPage());
        target.setIsLastPage(from.isIsLastPage());
        target.setHasPreviousPage(from.isHasPreviousPage());
        target.setHasNextPage(from.isHasNextPage());
        target.setNavigatePages(from.getNavigatePages());
        target.setNavigatepageNums(from.getNavigatepageNums());
        target.setNavigateFirstPage(from.getNavigateFirstPage());
        target.setNavigateLastPage(from.getNavigateLastPage());
        target.setTotal(from.getTotal());
    }
}
